//
//  NetworkTools.m
//  News
//
//  Created by Heaven on 15/7/23.
//  Copyright (c) 2015年 Heaven. All rights reserved.
//

#import "NetworkTools.h"

@implementation NetworkTools

+(instancetype)sharedManager{

    static NetworkTools *_tools;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        NSURL *baseURL = [NSURL URLWithString:@"http://c.m.163.com/nc/article/headline/"];
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        
        _tools = [[self alloc] initWithBaseURL:baseURL sessionConfiguration:config];
        
        // 扩展响应 JSON 反序列化支持的类型
        _tools.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", nil];
    });

    return _tools;
}

@end
